package me.ZFC.Text;

public class Test13 {
    public static void main(String[] args) {
        String a = "abcde";
        String b = "cdeab";
        boolean flag = check(a, b);
        System.out.println(flag);
    }

    public static boolean check(String a, String b) {
        for (int i = 0; i < a.length(); i++) {
            a = rotate(a);
            if (a.equals(b)) {
                return true;
            }
        }
        return false;
    }

    public static String rotate(String str) {
        String frist = str.substring(0, 1);
        String end = str.substring(1);
        return end + frist;
    }
}
